<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Hello WebSocket</title>
    <link href="https://cdn.bootcss.com/twitter-bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet">
    <link href="/main.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/sockjs-client/1.1.4/sockjs.min.js"></script>
    <script src="https://cdn.bootcss.com/stomp.js/2.3.3/stomp.min.js"></script>
    <script src="/app.js"></script>
</head>
<body>
<noscript>
    <h2 style="color: #ff0000">Seems your browser doesn't support Javascript! Websocket relies on Javascript being
        enabled. Please enable
        Javascript and reload this page!
    </h2>
</noscript>
<div id="main-content" class="container">

    <form>
        <div class="form-group">
            <label for="username">账号</label>
            <input type="email" class="form-control" id="username" aria-describedby="usernameHelp" placeholder="请输入账户">
            <small id="usernameHelp" class="form-text text-muted">你的账户是保密的</small>
        </div>
        <div class="form-group">
            <label for="password">密码</label>
            <input type="password" class="form-control" id="password" placeholder="请输入密码">
        </div>
        <button type="button" class="btn btn-primary btn-lg btn-block" id="login">登录</button>
    </form>
    
    <br>
    
    <div class="alert alert-danger" hidden role="alert" id="errorDiv">
        <h4 class="alert-heading">出错了!</h4>
        <p id="error"></p>
        <hr>
    </div>

    <div class="input-group" hidden id="tokenDiv" >
        <span class="input-group-addon" id="tokenSpan">token</span>
        <input class="form-control" placeholder="token" aria-label="token" id="token" aria-describedby="tokenSpan">
    </div>

    <br>

    <div class="row">
        <div class="col-md-6">
            <form class="form-inline">
                <div class="form-group">
                    <label for="connect">WebSocket 连接:</label>
                    <button id="connect" class="btn btn-default">连接</button>
                    <button id="disconnect" class="btn btn-default">断开</button>
                </div>
            </form>
        </div>
        <div class="col-md-6" id="sendDiv" hidden>
            <form class="form-inline">
                <div class="form-group">
                    <label for="name">WebSocket通信测试</label>
                    <input type="text" id="name" class="form-control">
                </div>
                <button id="send" class="btn btn-default" type="submit">发送</button>
            </form>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <table id="conversation" class="table table-striped">
                <thead>
                <tr>
                    <th>消息</th>
                </tr>
                </thead>
                <tbody id="greetings">
                </tbody>
            </table>
        </div>
    </div>
</div>
</body>
</html>
